package com.kinggm.controller;

import com.kinggm.annotation.DataSourceName;
import com.kinggm.model.Dog;
import com.kinggm.service.DogService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/dog")
public class DogController {

    @Resource
    private DogService dogService;

    @GetMapping("save")
    public String save(@RequestParam("name") String name) {
        Dog dog = new Dog();
        dog.setDogName(name);
//        dogService.save(dog);
        dogService.savePre(dog);
        return "保存成功";
    }

}
